<!-- Login -->
<% String userSes = (String) session.getAttribute("userName"); %>
<% String idi = (String) session.getAttribute("idioma"); %>
<% session.setAttribute("comprar",request.getAttribute("comprar")); %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<% if(userSes != null)
{
    request.getRequestDispatcher("/MyProfileServlet").forward(request, response);
}
else
{ %>

    <%@ page contentType="text/html" pageEncoding="UTF-8" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <fmt:setLocale value="<%=idi%>"/>
    <fmt:bundle basename="etiquetas" >
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <link rel="stylesheet" type="text/css" href="css/general.css" />
            <link rel="shortcut icon" href="../images/icons/favicon.ico"/>
            <script language="JavaScript" type="text/javascript" src="scripts/funciones.js"></script>
            <title><fmt:message key="titulo" /></title>
        </head>
        <body>
            <!-- Contenedor principal-->
            <div id="contenedor">

                <!-- Cabecera -->
                <div id="headerGeneral">
                    <jsp:include page="/WEB-INF/include/header.jsp" />
                </div>

                <!-- Contenido de la pagina -->
                <div id="content">

                    <!-- Contenido Izquiero Login : Registro -->
                    <div id="contentLeftLogin">
                        <img src="../images/template/qme_Logo_Welcome.png" alt=""></img>
                        <fmt:message key="login_registro" />

                        <form name="regisForm" action="/register.jsp">
                            <input id="loguearBtn" type="submit" value="<fmt:message key="boton_Registrarse" />" />
                        </form>
                    </div>
                        
                    <!-- Contenido Derecho Login : Login -->
                    <div id="contentRightLogin">
                        <p>
                            <span class="contentHeader"><fmt:message key="login_iniciar_sesion" /></span>
                        </p>
                        <form action="/loguear" name="loginForm" method="post" id="loginForm">
                            <fmt:message key="username" /><br />
                            <input id="username" name="username" type="text" size="30" maxlength="45" value="${username}" />
                            <span class="error" id="errorUser"><fmt:message key="error_CampoRequerido" /></span><br /><br />

                            <fmt:message key="password" /><br />
                            <input id="password" name="password" type="password" size="30" maxlength="45" value="${password}" />
                            <span class="error" id="errorPass"><fmt:message key="error_CampoRequerido" /></span><br /><br />
                            <input id="loguearBtn" type="button" value="<fmt:message key="login_iniciar_sesion" />" onclick="validarFormLogin()"/>
                            <span class="ok" id="mensaje">${mensaje}</span>
                        </form>
                    </div>
                </div>
                        
                <!-- Pie de pagina -->
                <%@include file="/WEB-INF/include/footer.jsp" %>
            </div>
        </body>
            
    </fmt:bundle>
    </html>
<% } %>